const glob = require('glob')
const path = require('path')
const cwd = process.cwd()

module.exports = function(jsPath){
    const entrys = {}
    const entryFiles = glob.sync(jsPath)
    const reg = /src\/(\S+)$/
          shortReg = /src\/js\/(\S+).js$/
    entryFiles.forEach((v) => {
      const filename = path.basename(v, path.extname(v))
      const pathname = v.match(reg)[1],
            shortname = v.match(shortReg)[1]
      entrys[shortname] = `./src/${pathname}`
    })
    return entrys
}